# Maintainer: George Rawlinson <grawlinson@archlinux.org>

pkgname=toot
pkgver=0.39.0
pkgrel=1
pkgdesc='A Mastodon CLI client'
arch=('any')
url='https://github.com/ihabunek/toot'
license=('GPL3')
depends=(
  'python'
  'python-requests'
  'python-beautifulsoup4'
  'python-wcwidth'
  'python-urwid'
  'python-tomlkit'
)
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-setuptools'
  'python-wheel'
)
_commit='509afd16a8479240f81d7566896ed9e97a1d109f'
source=("$pkgname::git+$url#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd "$pkgname"

  git describe --tags | sed 's/^v//'
}

build() {
  cd "$pkgname"

  python -m build --wheel --no-isolation
}

package() {
  cd "$pkgname"

  python -m installer --destdir="$pkgdir" dist/*.whl
}
